package tech.lithum.mm.ui.dashboard;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import java.util.ArrayList;
import java.util.List;

import tech.lithum.mm.adapter.Topic;
import tech.lithum.mm.adapter.TopicAdapter;
import tech.lithum.mm.adapter.User;
import tech.lithum.mm.api.Api;

public class DashboardViewModel extends ViewModel {
    private final MutableLiveData<List<Topic>> topics;

    public DashboardViewModel() {
        topics = new MutableLiveData<>();

        new Thread(new Runnable() {
            @Override
            public void run() {
                topics.postValue(Api.getApi().getTopics());
            }
        }).start();
    }

    public LiveData<List<Topic>> getTopics() {
        return topics;
    }
}